SVN_INC=-I$(SVN_HOME)\include
# FIXME: assume apr is located here, from tigris pre-built binaries install
APR_INC=-I$(SVN_HOME)\include\apr
JAVA_INC=-I$(JAVA_HOME)\include -I$(JAVA_HOME)\include\win32
INC=$(SVN_INC) $(JAVA_INC) $(APR_INC) -Iinclude

# FIXME: linking to MSVCRT gives me UnsatisfiedLinkErrors?
#CFLAGS=-nologo $(INC) -DWINDOWS -DWIN32 -MD
CFLAGS=-nologo $(INC) -DWINDOWS -DWIN32

SVN_LIB=$(SVN_HOME)\lib
APR_LIB=$(SVN_HOME)\lib\apr
LIBS=libsvn_repos-1.lib libsvn_subr-1.lib libsvn_fs-1.lib libapr-1.lib libsvn_delta-1.lib

SVNJ_DLL=svnj.dll

CLASSES=../web/WEB-INF/classes
JAVAPKG=com.googlecode.svnj

native-svnj: javahl $(SVNJ_DLL)

javahl:
	echo executing javah
	javah -classpath $(CLASSES) -d include $(JAVAPKG).EditorDriver
	javah -classpath $(CLASSES) -d include $(JAVAPKG).RepoContext

$(SVNJ_DLL): jniutil.obj editor-driver.obj repo-context.obj
#	echo ques $? at $@
	echo APR_LIB is $(APR_LIB)
	link -nologo -dll $? $(LIBS) -libpath:$(SVN_LIB) -libpath:$(APR_LIB) /OUT:$@

.c.obj:
	cl $(CFLAGS) -c $?

clean:
	del "*.obj" "*.dll" "*.lib"
	del /s/q include




